Skip to content

0400486024DEC000, tools: add PlayStation and Xbox RomFS controller overlays for Ocarina of Time - #2774

Open
zondy1i wants to merge 1 commit into
seedds:mainfrom
zondy1i:nxnative-oot-pad-overlays
Open

zondy1i wants to merge 1 commit into
seedds:mainfrom
zondy1i:nxnative-oot-pad-overlays

Conversation

@zondy1i

@zondy1i zondy1i commented Nov 15, 2026 •

Copy link
Copy Markdown

What and why

Companion to #2773 (DM_PAD_LAYOUT).

The Legend of Zelda: Ocarina of Time (0400486024DEC000, Switch 2 SDK 22.2.8) does not use the system extended shared font (nintendo_ext.ttf) for its in-game button icons. Instead, it draws button glyphs, ocarina notes, and controller diagrams from two RomFS archives:

  1. Font2/Scalable/External.Nin_Ounce_NVN2.bfotf.zs — an XOR-obfuscated (0xA6018502) OpenType CFF font containing the Nintendo Switch PUA button glyphs.
  2. UI/Layout2Archive/Common.Product.*.Nin_Ounce_NVN2.bntx.zs — a BNTX texture container with the 35 controller/prompt textures patched here:
    • ActionGuidePlus_00
    • KeyTexFontA_00, KeyTexFontB_00, KeyTexFontX_00, KeyTexFontY_00 (64×64 BC4 letter textures)
    • OcarinaButtonA_00, OcarinaButtonB_00, OcarinaButtonX_00, OcarinaButtonY_00, OcarinaButtonL_00, OcarinaButtonR_00 (93×93 ASTC 4×4 sRGB melody note textures)
    • Controller_{Pro,Grip,Console}, Controller_{Pro,Grip,Console}1, ControllerSh_{Pro,Grip,Console}1, and ControllerGuide_{Pro,Grip,Console}_{00..04} (pause-menu controller diagrams and callout overlays)

This PR adds a build-time RomFS overlay generator (scripts/oot_pad_overlay.py + dm/tools/oot_pad_overlay.m) that reads the player's own RomFS (image or folder) and generates overlay_playstation/ and overlay_xbox/ during Mac and iOS packaging (scripts/build_ipa_from_nsp.py, dm/mac/pack_app.py, dm/ios/tools/build_ipa.sh):

  • External CFF font patching (scripts/oot_pad_overlay.py): decrypts Font2/Scalable/External.Nin_Ounce_NVN2.bfotf.zs, replaces the CFF charstrings with PlayStation (Cross, Circle, Square, Triangle, L1, R1, L2, R2, Options, Create) or Xbox (A, B, X, Y, LB, RB, LT, RT, Menu, View) vector outlines, and re-encrypts/compresses with the game's zstd dictionary (Pack/ZsDic.pack.zs).
  • BNTX texture patching (dm/tools/oot_pad_overlay.m): decodes the 35 target textures in Common.Product.*.bntx.zs, renders PlayStation/Xbox symbols into ActionGuidePlus_00, KeyTexFont*, and OcarinaButton*, composites the contributor-created DualSense (dm/games/0400486024DEC000/controller_dualsense.png) and Xbox Series (dm/games/0400486024DEC000/controller_xbox.png) controller illustrations, redraws the ControllerGuide_* callout lines/highlights for each controller, and re-encodes the BNTX in-place.
  • Zero Nintendo assets or RomFS files are committed to the repository.

How it was tested

  • Verified in-game in 0400486024DEC000 (v131072) on macOS across DM_PAD_LAYOUT=switch, DM_PAD_LAYOUT=playstation, and DM_PAD_LAYOUT=xbox (HUD action prompts, dialogue prompts, ocarina prompts, and pause-menu Controller screen).
  • Verified scripts/oot_pad_overlay.py output against all 35 textures and both .bfotf.zs fonts.
  • DM_GAME=010015100B514000 python3 -m unittest -v dm/tools/tests/test_docs.py dm/tools/tests/test_usage.py dm/tools/tests/test_pr_areas.py dm/tools/tests/test_nsp_mac_app.py (105 tests, OK)

@github-actions github-actions Bot added packing Building an IPA or a Mac app: the NSP script, extraction, the shader split, the packers ios The iPhone and iPad app (dm/ios) mac The Mac front end and app (dm/mac, front_mac.m) tools Tools and scripts (dm/tools, scripts) docs Documentation game: 0400486024DEC000 A game labels Nov 15, 2026
@zondy1i
zondy1i force-pushed the nxnative-oot-pad-overlays branch from 04eee24 to 06ece95 Compare November 15, 2026 15:58
zee2ex2 pushed a commit to zee2ex2/It-sworda-just-works that referenced this pull request Nov 18, 2026
…ution mode

- nvn: retire idle cache-only shared textures above 75% resident (seedds#2745)
- nvn: finalized pools drop serial entries naming their textures (seedds#2775)
- mac: PlayStation/Xbox controller overlays (seedds#2774) with DM_PAD_LAYOUT
- launcher: resolution overlay picks docked/handheld via DM_OPMODE; pad overlay first
- overlays: position-based button mapping (host remaps non-Nintendo pads by position)
@Scvairy

Scvairy commented Nov 18, 2026 •

Copy link
Copy Markdown
Contributor

Some OoT findings from an Xbox/PlayStation prompt mod for the Mac app. They may help this PR cover the remaining Switch prompts.

Prompts this PR doesn't touch yet (all in UI/Layout2Archive/Common.Product.100.Nin_Ounce_NVN2.{bntx,blarc}.zs):

  • Ocarina staff notes: the "play this melody" sheets draw OcarinaButtonA/B/X/Y/L/R_00. These are 93×93 ASTC 4×4 sRGB textures in Common…bntx, separate from the font, so they keep showing A/B/X/Y. With block height 4, the 16-byte blocks sit in each GOB in the bit order y0, y1, x0, y2, x1 (block coordinates, low bit first).
  • Letter textures: KeyTexFontA/B/X/Y_00 (64×64 BC4) are drawn in some layouts alongside the font glyphs.
  • HUD action diamond: DoCommand_00.buil in Common…blarc places A/B/X/Y by position. The SARC lists it four times (same name and hash, identical data), so an overlay has to patch all four copies.

A "western" option. Many players who switch to Xbox/PlayStation prompts also want confirm on the bottom button. In OoT the A/B swap alone is enough on the input side. For icons, the "Western" files of DualSense & Xbox Button Prompts (Makine Çeviri, made for this game) already cover the font, the HUD diamond, the ocarina notes and the Controls screen. A small mod that does the A/B swap in sead::Controller::calc and installs that pack as a DM_ROMFS_OVERLAY is here: https://github.com/Scvairy/oot-nxnative-western-buttons. A layout option along these lines could fit #2773's DM_PAD_LAYOUT.

@gnavarro24

Copy link
Copy Markdown
Contributor

Hi! This branch is based on a main from before commit c70c242 ("ci: repair host and tool test failures on main"). Most of the failing checks here (Host unit tests, Tool tests, clang-tidy, Build check) come from that older base, not from this change.

To pick up the fix, merge the current main into this branch and push:

git fetch origin
git merge origin/main
git push

If the merge has conflicts, ask here if you want help with them.

@zondy1i
zondy1i force-pushed the nxnative-oot-pad-overlays branch from 06ece95 to 87fd329 Compare November 20, 2026 15:37
@zondy1i

zondy1i commented Nov 20, 2026

Copy link
Copy Markdown
Author

Thanks @Scvairy and @gnavarro24!

  • Rebased onto current main (72e81a3, picking up c70c242d) and resolved the merge conflicts.
  • Updated dm/games/0400486024DEC000/README.md and the PR description — my original write-up had stale paths (UI/Controller/...), which made it look like Common.Product.*.bntx.zs wasn't covered. scripts/oot_pad_overlay.py + dm/tools/oot_pad_overlay.m actually already patch Font2/Scalable/External.Nin_Ounce_NVN2.bfotf.zs plus all 35 textures in UI/Layout2Archive/Common.Product.*.Nin_Ounce_NVN2.bntx.zs, including ActionGuidePlus_00, KeyTexFontA/B/X/Y_00 (64×64 BC4), and OcarinaButtonA/B/X/Y/L/R_00 (93×93 ASTC 4×4 sRGB).
  • Good note on DoCommand_00.buil (and the 4 duplicate SARC entries) for a western HUD diamond position swap — since host, ios, tools: add PlayStation and Xbox controller layout support (DM_PAD_LAYOUT) #2773's DM_PAD_LAYOUT=xbox|playstation maps the bottom button to Switch A (confirm), patching DoCommand_00.buil to match physical diamond positions is a great follow-up if we want to move the HUD slots as well.

@seedds

seedds commented Nov 21, 2026

Copy link
Copy Markdown
Owner

Thanks, zondy1i, for rebasing and clarifying what the overlay covers. Ocarina’s own HUD and ocarina prompts use game assets, so the shared font changes in #2773 and the input mapping in #3018 leave this piece open. The PR is mergeable today. I’m leaving it open while the shared controller layout in #2773 is decided.

@zondy1i
zondy1i force-pushed the nxnative-oot-pad-overlays branch from 87fd329 to 122e224 Compare November 24, 2026 08:26
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

docs Documentation game: 0400486024DEC000 A game ios The iPhone and iPad app (dm/ios) mac The Mac front end and app (dm/mac, front_mac.m) packing Building an IPA or a Mac app: the NSP script, extraction, the shader split, the packers tools Tools and scripts (dm/tools, scripts)

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants